/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

import engine.Edge;
import engine.Engine;
import engine.Time;
import engine.Unit;
import java.util.ArrayList;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

/**
 *
 * @author Johnny
 */
public class EngineTester {

    public EngineTester() {
    }

    @BeforeClass
    public static void setUpClass() throws Exception {
    }

    @AfterClass
    public static void tearDownClass() throws Exception {
    }

    @Before
    public void setUp() {
    }

    @After
    public void tearDown() {
    }

    @Test
    public void hello() {
        Engine engine = new Engine();
// <editor-fold defaultstate="collapsed" desc="tested methods">
//        ArrayList<Node> nodeList = engine.getNodes();
//        for (Node node : nodeList) {
//            System.out.println(node);
//        }
//        System.out.println();

        //engine.addNode(23, 10, "Grigo");
//        engine.removeNode(15);
//        for (Node node : nodeList) {
//            System.out.println(node);
//        }
//        System.out.println();

//        ArrayList<Node> equalNodes = engine.getUnitNodes(13);
//        for (Node node : equalNodes) {
//            System.out.println(node);
//        }// </editor-fold>

        ArrayList<Unit> unitList = engine.getUnits();
        for (Unit unit : unitList) {
            System.out.println(unit);
        }
        System.out.println();

        ArrayList<Edge> edgeList = engine.getEdges();

// <editor-fold defaultstate="collapsed" desc="tested setNodePos method">
//        engine.setNodePos(1, (float)12.5, 12);
//        engine.setNodePos(9, 30, 20);
//        engine.setNodePos(4, 65, 20);
//        engine.setNodePos(2, 90, (float)12.5);
//        engine.setNodePos(13, 75, 80);
//        engine.setNodePos(10, 60, 60);
//        engine.setNodePos(11, 60, 50);
//        engine.setNodePos(14, 5, 50);

//        ArrayList<Node> nodeList = engine.getNodes();
//        for (Node node : nodeList) {
//            System.out.println(node);
//        }// </editor-fold>

//// <editor-fold defaultstate="collapsed" desc="tested setSchedule method">
        ArrayList<Time> newTimes = new ArrayList<Time>();
//        newTimes.add(new Time(1));
//        newTimes.add(new Time(5));
//        newTimes.add(new Time(10));
//        newTimes.add(new Time(17));
//        engine.setSchedule(1, 1, newTimes);// </editor-fold>

//// <editor-fold defaultstate="collapsed" desc="tested methods of Path">
//        Path p = new Path(unitList.get(0));
//        p.revalidate(edgeList);
//        for (Edge edge : p.edges) {
//            System.out.println(edge);
//        }
//        System.out.println();
//
//        for (int i = 1; i <= 22; i++) {
//            LookUpData ld = p.getPos(unitList.get(0).getInstances().get(0), new Time(i));
//            Node pos = ld.getEdge().getAbstractPos(ld.getF());
//            System.out.println(pos.getX() + " " + pos.getY());
//        }

        // </editor-fold>

// <editor-fold defaultstate="collapsed" desc="tested methods">
//        engine.addUnit("35");
//        engine.addUnitCourse(6, 14);
//        engine.addUnitCourse(6, 2);
//        engine.removeUnit(5);
//        engine.removeUnitCourse(6, 14);
//        engine.addInstance(6);
//
//        unitList = engine.getUnits();
//        for (Unit unit : unitList) {
//            System.out.println(unit);
//        }
//        System.out.println();// </editor-fold>
    }
}